package com.summer.framework.bill.controller.rest;

import com.summer.framework.bill.entity.BillType;
import com.summer.framework.bill.service.BillTypeService;
import com.summer.framework.common.controller.BaseController;
import com.summer.framework.common.entity.response.BooleanResponse;
import com.summer.framework.common.exception.NotFoundException;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @auther: 杨杰
 * @date: 2019/2/21 14:39
 * @description:
 */
@RestController
@RequestMapping("/type")
@Slf4j
public class BillTypeController extends BaseController<BillTypeService, BillType> {

    @PutMapping("/submit/{id}")
    public BooleanResponse submit(@PathVariable String id) throws NotFoundException {
        boolean result = baseService.submit(id);
        return BooleanResponse.BooleanResponseBuilder.aBooleanResponse().data(result).build();
    }
}
